CREATE TABLE [dbo].[FileAttach]
(
[FileAttachId] [int] NOT NULL IDENTITY(1, 1),
[ProductId] [int] NULL,
[EmailTemplateId] [int] NULL,
[Name] [nvarchar] (128) COLLATE Cyrillic_General_CI_AS NOT NULL,
[MimeType] [nvarchar] (128) COLLATE Cyrillic_General_CI_AS NOT NULL,
[FileSize] [int] NOT NULL,
[Description] [nvarchar] (256) COLLATE Cyrillic_General_CI_AS NULL,
[CreatedDate] [datetime] NOT NULL,
[LastModifiedDate] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FileAttach] ADD CONSTRAINT [PK_FileAttach] PRIMARY KEY CLUSTERED  ([FileAttachId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FileAttach] ADD CONSTRAINT [FK_FileAttach_EmailTemplate] FOREIGN KEY ([EmailTemplateId]) REFERENCES [dbo].[EmailTemplate] ([EmailTemplateId])
GO
ALTER TABLE [dbo].[FileAttach] ADD CONSTRAINT [FK_FileAttach_Product] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Product] ([ProductId])
GO
